package view;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.ImageIcon;

import java.awt.Color;
import java.awt.event.ActionListener;

import javax.swing.JLabel;
import java.awt.event.ActionEvent;
import javax.swing.SwingConstants;
import java.awt.Font;
/**
 * main menu for sales men 
 * @author liran 
 *
 */
public class SalesManGui extends AbstractGUI {
/**
 * get customer list
 */
	private JButton btnGetCustomerList= null;
	/**
	 * logOut
	 */
	private JButton LogOutB = null;
	/**
	 * customer history
	 */
	private JButton btnCustomerHistory = null;



	/**
	 * Create the frame.
	 */
	public SalesManGui() {
	//	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(500, 200, 450, 300);
		setLocationRelativeTo(null);
		getContentPane().setBackground(new Color(51, 102, 153));
		getContentPane().setLayout(null);
		
		btnGetCustomerList = new JButton("Get customer list");
		btnGetCustomerList.setBounds(268, 112, 176, 40);
		getContentPane().add(btnGetCustomerList);
		
		LogOutB = new JButton("Log out");
		LogOutB.setVerticalAlignment(SwingConstants.BOTTOM);
		LogOutB.setIcon(new ImageIcon(SalesManGui.class.getResource("/com/sun/java/swing/plaf/windows/icons/image-failed.png")));
		LogOutB.setBounds(324, 0, 120, 34);
		getContentPane().add(LogOutB);
		
		btnCustomerHistory = new JButton("Customer history");
		btnCustomerHistory.setBounds(268, 163, 176, 40);
		getContentPane().add(btnCustomerHistory);
		
		JLabel lblSalesMenu = new JLabel("Sales menu");
		lblSalesMenu.setFont(new Font("SimSun-ExtB", Font.BOLD | Font.ITALIC, 28));
		lblSalesMenu.setBounds(10, 98, 302, 96);
		getContentPane().add(lblSalesMenu);
		
		JLabel lblNewLabel = new JLabel("CCRM...");
		lblNewLabel.setForeground(new Color(255, 0, 0));
		lblNewLabel.setFont(new Font("Stencil", Font.PLAIN, 34));
		lblNewLabel.setBounds(10, 11, 258, 83);
		getContentPane().add(lblNewLabel);
		setResizable(false);
		setVisible(true);
	}




public void addGetCustListAL(ActionListener listener)
{
	btnGetCustomerList.addActionListener(listener);
}

public void addLogOutAL(ActionListener listener)
{
	LogOutB.addActionListener(listener);
}

public void addCustomerHistoryAL(ActionListener listener)
{
	btnCustomerHistory.addActionListener(listener);
}
}
